<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateSmsCodeTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('sms_code', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('mobile',12)->nullable()->comment('手机号');
            $table->string('email',60)->nullable()->comment('电子邮箱');
            $table->string('code',20)->comment('验证码');
            $table->string('text',300)->nullable()->comment('短信文本');
            $table->unsignedTinyInteger('type',false)->default(0)->comment('类型');
            $table->unsignedInteger('expire_time',false)->default(0)->comment('过期时间');
            $table->timestamps();
            $table->softDeletes();
            $table->engine="InnoDb";
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('sms_code');
    }
}
